﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BTKERP.Common.ConfigHelper;

namespace BTKERP.DAL.DataAccess
{
    public partial class DBContext
    {
        static ConnectionQueue _ConQueue = new ConnectionQueue(SystemConfigHelper.GetIntValue("ConnectionPoolSize"));

        internal Connection ConnectionInfo
        {
            get
            {
                Connection orcon = _ConQueue.Dequeue();
                if (orcon == null)
                {
                    orcon = new Connection();

                }
                return orcon;
            }
            set
            {
                _ConQueue.EnQueue(value);
            }
        }
    }
}
